package com.list.arraylist;

import java.util.ArrayList;
import java.util.List;

class EmployeeDetails{
	int id;
	String name;
	public EmployeeDetails() {
		
	}
public EmployeeDetails(int id,String name) {
		this.id=id;
		this.name=name;
	}
public String toString(){
	return id+"\t"+name;
}
}

public class Employee {
public static void main(String[] args) {
	EmployeeDetails ed1=new EmployeeDetails(2, "ramesh");
	EmployeeDetails ed2=new EmployeeDetails(1, "somesh");
	EmployeeDetails ed3=new EmployeeDetails(3, "amit");
	ArrayList list=new ArrayList();
	list.add(ed1);
	list.add(ed2);
	list.add(ed3);
	for(Object o:list){
		System.out.println(o);
	}
}
}
